package com.neusoft.neu24.myaspect.service.impl;

import com.neusoft.neu24.myaspect.aops.QieMian;
import com.neusoft.neu24.myaspect.service.IMemberService;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
public class MemberService  implements IMemberService {
    @Transactional
    public void add(){
//        deptMapper
//        empMapper
//        memberMapper();
    }

    @Override
    public int  addMember(int  i ) {
        System.out.println(QieMian.index);
        System.out.println(i );
        System.out.println("MemberServiceImpl.addMember");
        if ( System.currentTimeMillis() %2 == 0  ){
            int j = 0 ;
            j =  i / j ;
        }
        return  i+1;
    }

    @Override
    public void selectAll() {
        System.out.println("selectAll");
        System.out.println(QieMian.index);
    }

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        IMemberService memberServiceImpl = (IMemberService) context.getBean("memberService");
//        memberServiceImpl.selectAll();
        memberServiceImpl.addMember(123);
    }
}
